package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh市场设置Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by sxy on 2016/7/13.
 */
public interface Lsh市场设置Repository extends JpaRepository<Lsh市场设置Model, Integer>, JpaSpecificationExecutor<Lsh市场设置Model> {
    @Query("select a from Lsh市场设置Model a where a.渠道=?2 and a.来源分类=?3 and a.来源=?4 and (a.许可=?1 or a.许可='LSH')")
    List<Lsh市场设置Model> getMarketId(String permit, String channel, String sourceType, String source);
    
    @Query("select u from Lsh市场设置Model u where u.渠道=?1 and u.来源分类=?2 and u.来源=?3 and (u.许可=?4 or u.许可='LSH')")
    Lsh市场设置Model   getLsh市场设置Model(String qudao,String qdly,String ly,String permit);

    @Query("select a from Lsh市场设置Model a where a.渠道=?2  and a.来源=?3 and (a.许可=?1 or a.许可='LSH')")
    List<Lsh市场设置Model> findBy许可And渠道And来源(String permit, String channel, String source);

    @Query("select a from Lsh市场设置Model a where (a.许可 = ?1 or a.许可 = 'LSH')")
    List<Lsh市场设置Model> getMoByDlr(String dlr);
}
